Fix minor mem leaks in garmin_gpi, bushnell, bushnell_trl, delgpl
authorrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 12 Nov 2011 22:18:12 +0000 (22:18 +0000)
committerrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 12 Nov 2011 22:18:12 +0000 (22:18 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4104 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/bushnell.c
gpsbabel/bushnell_trl.c
gpsbabel/delgpl.c
gpsbabel/garmin_gpi.c

index aafe1478c36a2591c2c4a8a5a4f083f77573fb49..029cbca5928dd8d3da4ffe6c9d1f4d34ea00201c 100644 (file)
@@ -245,6 +245,7 @@ bushnell_write_one(const waypoint* wpt)
   gbfwrite(padding, sizeof(padding), 1, file_out);
 
   xfree(fname);
+  xfree(ident);
   gbfclose(file_out);
 }
 
index 941c2f445c13215943dc3baae144ce0d96171a23..7d1f17332502f8731c9803e056cdcc413093cacb 100644 (file)
@@ -49,7 +49,7 @@ rd_init(const char* fname)
 static void
 rd_deinit(void)
 {
-  gbfclose(file_out);
+  gbfclose(file_in);
 }
 
 static void
index 881616caaa1d3fc2ebda611125e47bdbcfe71247..29006c7ff722689a468765a46e3292458926c2f0 100644 (file)
@@ -95,6 +95,7 @@ gpl_read(void)
     // in time.  The only thing I see "special" about those
     // trackpoints is that these fields are zeroed.  Toss them.
     if ((wpt_tmp->speed == 0.0) && (wpt_tmp->course == 0.0)) {
+      waypt_free(wpt_tmp);
       continue;
     }
     track_add_wpt(track_head, wpt_tmp);
index 9f2930079a57ef0379182f48d638d541659a13ed..89ccee49b2cab1dc02603761c83ce43abd7253eb 100644 (file)
@@ -642,7 +642,7 @@ read_tag(const char* caller, const int tag, waypoint* wpt)
       GMSD_SET(email, str);
     }
     if ((mask & 0x10) && (str = gpi_read_string("Link"))) {
-      waypt_add_url(wpt, xstrdup(str), xstrdup(str));
+      waypt_add_url(wpt, xstrdup(str), str);
     }
     break;